<template>
    <div class="flex bottomBox">
        <div class="boxShadow stationSetComponent">
            <el-form ref="ruleForm" :model="stationForm" class="wifiForm">
                <p class="boldTitle">添加轨迹</p>
                <el-form-item class="">
                    <div class="flex formItem">
                        <div class="itemLeft">轨迹名称</div>
                        <div class="itemRight"><input type="text" placeholder="请输入站点名称" v-model="stationForm.name"></div>
                    </div>
                </el-form-item>

                <el-form-item>
                    <div class="flex formItem">
                        <div class="itemLeft">选择站点</div>
                        <div class="itemRight">
                            <el-select v-model="stationForm.stations" placeholder="请选择站点" multiple size="mini" class="stationType">
                                <el-option
                                v-for="(item,index) in this.$store.state.stationList"
                                :key="index"
                                :label="item.name"
                                :value="item.name">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                </el-form-item>

                <div class="flex formBtns">
                    <el-button size="small" type="primary" @click="subUpdate">提交</el-button>
                </div>
            </el-form>
        </div>
    </div>
</template>

<script>
import { submitAddTrack } from '../js/methods'
export default {
    name: 'trackAdd',
    components:{

    },
    data(){
        return{
            stationForm:{
                name:'',
                stations: '',
            },
            
        }
    },
    methods:{
        //提交
        subUpdate() {            
            submitAddTrack(this.stationForm);
      }
    },

    //属性监听
    watch:{
      
    }

}
</script>

<style scoped lang="less">
 .stationSetComponent{
     background-color: #ffffff;
     border-top-left-radius: 4px;
     border-top-right-radius: 4px;
     padding: 10px;
     text-align: left;
     font-size: 14px;
     width: 100%;
 }
 .boldTitle{
     font-weight: bold;
     margin-bottom: 7.5px;
 }
 .formItem{
    padding: 10px 0;
     border-bottom: 1px solid #eeeeee;
    .itemLeft{
        flex: 4
    }
    .itemRight{
        flex: 6;
        input{
            width: 100%;
            height: 100%;
            display: block;            
        }
    }
 }
 .stationType{
     input{
         height: 10px;
     }
     .el-input__icon{
         height:inherit
     }
     .el-input__inner{
         height: normal;
         line-height: normal
     }
    width: 100%;
    border: none;
    outline: none;
    padding-left: 0.7em;
}
 .formBtns{
     padding: 0 5px;
     margin-top: 15px;
     button{
         width: 100%;
     }
 }
 .el-form-item{
     margin-bottom: 0;
 }
 .wifiForm div{
    line-height:normal;
 }
 
  .el-form-item__content{
        line-height: 20px;
    }
</style>